﻿<phone:PhoneApplicationPage 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
	x:Class="Day2.AnimationPage"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource PhoneForegroundBrush}"
	Orientation="Portrait"
	shell:SystemTray.IsVisible="True">
	<phone:PhoneApplicationPage.Resources>
		<Storyboard x:Name="MyStoryBoard" RepeatBehavior="Forever" AutoReverse="True">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Top)" Storyboard.TargetName="myBall">
				<EasingDoubleKeyFrame KeyTime="0" Value="8"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="680">
					<EasingDoubleKeyFrame.EasingFunction>
						<BounceEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="myBall">
				<EasingColorKeyFrame KeyTime="0" Value="Blue"/>
				<EasingColorKeyFrame KeyTime="0:0:1" Value="Red">
					<EasingColorKeyFrame.EasingFunction>
						<BounceEase EasingMode="EaseOut"/>
					</EasingColorKeyFrame.EasingFunction>
				</EasingColorKeyFrame>
			</ColorAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="myBall">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="363.636"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="369.454"/>
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="2.909"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="myBall">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-209.455"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="-663.273"/>
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="-672"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="myRect">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="360"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="myRect">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="myRect">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="-38"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationZ)" Storyboard.TargetName="myRect">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="-59"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="myRect">
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="-27"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</phone:PhoneApplicationPage.Resources>
	<Canvas>
		<Button x:Name="bntStart" Content="Start Storyboard" Height="206" Canvas.Left="145" Canvas.Top="554" Width="327" Click="bntStart_Click" Style="{StaticResource MyHeartButton}"/>
		<Ellipse x:Name="myBall" Fill="#FFF4F4F5" Height="80" Canvas.Left="8" Stroke="Black" Canvas.Top="8" Width="80" RenderTransformOrigin="0.5,0.5">
			<Ellipse.RenderTransform>
				<CompositeTransform/>
			</Ellipse.RenderTransform>
		</Ellipse>
		<Rectangle x:Name="myRect" Height="181" Canvas.Left="121" Stroke="Black" Canvas.Top="88" Width="227" RenderTransformOrigin="0.5,0.5">
			<Rectangle.Projection>
				<PlaneProjection/>
			</Rectangle.Projection>
			<Rectangle.RenderTransform>
				<CompositeTransform/>
			</Rectangle.RenderTransform>
			<Rectangle.Fill>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#FF6FFF30" Offset="0"/>
					<GradientStop Color="Red" Offset="1"/>
				</LinearGradientBrush>
			</Rectangle.Fill>
		</Rectangle>
	</Canvas>

	<!--LayoutRoot is the root grid where all page content is placed-->
</phone:PhoneApplicationPage>